import 'package:library_base/entities/generated/json/base/json_convert_content.dart';
import 'package:library_base/entities/weighing_goods_child_entity.dart';

WeighingGoodsChildEntity $WeighingGoodsChildEntityFromJson(Map<String, dynamic> json) {
  final WeighingGoodsChildEntity loginBeanEntity = WeighingGoodsChildEntity();

  final String? stockOutId = jsonConvert.convert<String>(json['stockOutId']);
  if (stockOutId != null) {
    loginBeanEntity.stockOutId = stockOutId;
  }
  final String? goodsCode = jsonConvert.convert<String>(json['goodsCode']);
  if (goodsCode != null) {
    loginBeanEntity.goodsCode = goodsCode;
  }

  final bool? singleEntry = jsonConvert.convert<bool>(json['singleEntry']);
  if (singleEntry != null) {
    loginBeanEntity.singleEntry = singleEntry;
  }
  final String? goodsName = jsonConvert.convert<String>(json['goodsName']);
  if (goodsName != null) {
    loginBeanEntity.goodsName = goodsName;
  }

  final String? goodsBarCode = jsonConvert.convert<String>(json['goodsBarCode']);
  if (goodsBarCode != null) {
    loginBeanEntity.goodsBarCode = goodsBarCode;
  }

  final String? batchNo = jsonConvert.convert<String>(json['batchNo']);
  if (batchNo != null) {
    loginBeanEntity.batchNo = batchNo;
  }

  final String? locationId = jsonConvert.convert<String>(json['locationId']);
  if (locationId != null) {
    loginBeanEntity.locationId = locationId;
  }

  final String? locationName = jsonConvert.convert<String>(json['locationName']);
  if (locationName != null) {
    loginBeanEntity.locationName = locationName;
  }

  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    loginBeanEntity.status = status;
  }

  final double? stockOutCount = jsonConvert.convert<double>(json['stockOutCount']);
  if (stockOutCount != null) {
    loginBeanEntity.stockOutCount = stockOutCount;
  }

  final double? stockOutWeigh = jsonConvert.convert<double>(json['stockOutWeigh']);
  if (stockOutWeigh != null) {
    loginBeanEntity.stockOutWeigh = stockOutWeigh;
  }

  final double? mainWeigh = jsonConvert.convert<double>(json['mainWeigh']);
  if (mainWeigh != null) {
    loginBeanEntity.mainWeigh = mainWeigh;
  }

  final double? subWeigh = jsonConvert.convert<double>(json['subWeigh']);
  loginBeanEntity.subWeigh = subWeigh??0.0;

  final double? skinMainWeight = jsonConvert.convert<double>(json['skinMainWeight']);
  loginBeanEntity.skinMainWeight = skinMainWeight??-1;

  final double? skinWeight = jsonConvert.convert<double>(json['skinWeight']);
  loginBeanEntity.skinWeight = skinWeight??0;

  final String? address = jsonConvert.convert<String>(json['address']);
  loginBeanEntity.address = address??"";

  return loginBeanEntity;
}

Map<String, dynamic> $WeighingGoodsChildEntityToJson(WeighingGoodsChildEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['stockOutId'] = entity.stockOutId;
  data['goodsCode'] = entity.goodsCode;
  data['singleEntry'] = entity.singleEntry;
  data['goodsName'] = entity.goodsName;
  data['goodsBarCode'] = entity.goodsBarCode;
  data['batchNo'] = entity.batchNo;
  data['locationId'] = entity.locationId;
  data['locationName'] = entity.locationName;
  data['status'] = entity.status;
  data['stockOutCount'] = entity.stockOutCount;
  data['stockOutWeigh'] = entity.stockOutWeigh;
  data['mainWeigh'] = entity.mainWeigh;
  data['subWeigh'] = entity.subWeigh;
  data['skinMainWeight'] = entity.skinMainWeight;
  data['skinWeight'] = entity.skinWeight;
  data['address'] = entity.address;
  return data;
}
